package com.shuwen.gcdj.mapper.mysql.message;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shuwen.gcdj.bean.message.request.AlarmmessageQueryReq;
import com.shuwen.gcdj.bean.message.request.OrderMessageQueryReq;
import com.shuwen.gcdj.bean.message.request.PLCAlarmMessageManageQueryReq;
import com.shuwen.gcdj.bean.message.request.PLCAlarmMessageManageReq;
import com.shuwen.gcdj.bean.message.response.AlarmMessageResp;
import com.shuwen.gcdj.bean.message.response.OrderMessageResp;
import com.shuwen.gcdj.bean.message.response.PLCAlarmMessageResp;
import com.shuwen.gcdj.entity.MsgOrdermessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author yangx
 */
@Mapper
public interface MessageCenterMapper extends BaseMapper<MsgOrdermessage> {
    /**
     * 同步PLC数据
     * @return
     */
    Integer addBatch(@Param("list") List<PLCAlarmMessageResp> resp);

    Integer updatePlcSignByIds(@Param("ids") List<String> req);

    IPage<AlarmMessageResp> getAlarmMessagePage(Page<AlarmMessageResp> page, @Param("bean") AlarmmessageQueryReq req);

    IPage<OrderMessageResp> getOrderMessagePage(Page<OrderMessageResp> page, @Param("bean") OrderMessageQueryReq req);

    IPage<PLCAlarmMessageResp> getPLCAlarmMessagePage(Page<PLCAlarmMessageResp> page, @Param("bean") PLCAlarmMessageManageQueryReq req);

    List<PLCAlarmMessageResp> getLastPLCAlarmMessageList(@Param("bean") PLCAlarmMessageManageReq req);
}
